# from  time import sleep
from time import sleep

# from selenium import webdriver
from selenium import  webdriver

# driver=webdriver.Chrome()
driver = webdriver.Chrome()

# driver.maximize_window()
driver.maximize_window()    #最大窗口
# driver.implicitly_wait(10)
driver.implicitly_wait(10)
url='https://www.baidu.com/'
url1='https://mail.163.com/'
driver.get(url1)
sleep(2)
#窗口切换的第二种方式  通过javascript脚本  ,移除连接标签中的 target  属性 ,当前窗口打开新的url
# js = 'document.getElementById("head").children[2].children[1].removeAttribute("target")'
# javascript 语法可以做 输入.value  点击操作 click() removeAttribute(属性名) setAttribute("属性名","属性值")
# js='document.getElementById("head").children[2].children[1].removeAttribute("target")'
# js='document.getElementById("head").children[2].children[1].setAttribute("abc","abc")'
# driver.execute_script(js)
# sleep(2)
# driver.find_element_by_link_text("hao123").click()
# sleep(5)
print(1)
frame = driver.find_element_by_css_selector('[frameborder="0"][scrolling="no"]')
driver.switch_to.frame(frame)    #切入指定的  frame  中
sleep(2)

driver.find_element_by_name('email').send_keys('18391194498')
print(2)
driver.switch_to.default_content()    #切换回默认html界面


driver.find_element_by_link_text('登录反馈').click()


# driver.quit()